<?php

namespace backend\modules\home\models;

use Yii;

/**
 * This is the model class for table "mh_order".
 *
 * @property int $id
 * @property int $uid
 * @property string $out_trade_no
 * @property string $pay_type
 * @property string $transaction_id
 * @property string $subject
 * @property string $total_amount
 * @property string $remark
 * @property string $callback
 * @property string $status
 * @property string $date
 * @property int $create_at
 * @property int $update_at
 */
class Order extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'mh_order';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['uid', 'out_trade_no', 'subject', 'total_amount', 'date'], 'required'],
            [['uid', 'create_at', 'update_at'], 'integer'],
            [['pay_type', 'status', 'callback'], 'string'],
            [['total_amount'], 'number'],
            [['out_trade_no', 'transaction_id'], 'string', 'max' => 64],
            [['subject'], 'string', 'max' => 30],
            [['remark'], 'string', 'max' => 255],
            [['date'], 'string', 'max' => 20],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'uid' => 'Uid',
            'out_trade_no' => 'Out Trade No',
            'pay_type' => 'Pay Type',
            'transaction_id' => 'Transaction ID',
            'subject' => 'Subject',
            'total_amount' => 'Total Amount',
            'remark' => 'Remark',
            'callback' => 'Callback',
            'status' => 'Status',
            'date' => 'Date',
            'create_at' => 'Create At',
            'update_at' => 'Update At',
        ];
    }
}
